<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
</head>
<body class="page-header-fixed">
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
<div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
<div class="page-content-wrapper">
<div class="page-content">
<div class="row">
<div class="col-md-12">
<form class="form-horizontal form-row-seperated" action="${path}/help/save" method="post">
<div class="portlet box purple">
<div class="portlet-title">
    <div class="caption">
        <i class="fa fa-shopping-cart"></i>详细信息
    </div>
    <div class="actions btn-set">
        <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left" title="返回">返回</i></a>
        <a href="javascript:location.reload();" class="btn green"><i class="fa fa-reply" title="重置"></i></a>
        <button type="button" class="btn blue save"><i class="fa fa-check" title="保存"></i></button>
    </div>
</div>
<div class="portlet-body">
    <div class="tabbable">
        <div class="tab-content no-space">
            <div class="tab-pane active" id="tab_general">
                <div class="form-body">
                    <div class="form-group">
                        <label class="col-md-2 control-label">栏目:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-5">
                            <select name="columnid" class="form-control">
                                <c:forEach items="${column}" var="s">
                                    <option value="${s.id}"
                                            <c:if test="${data.columnid==s.id}">selected="selected"</c:if> >${s.value0}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">标题:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-5">
                            <input type="text" id="title" name="title"
                                   class="form-control measure-input" datatype="*1-80"
                                   value="${data.title}"/>
                        </div>
                        <div class="col-md-5">
                            &nbsp;可输入<b><span id="title_len">80</span></b> 个字符
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">关键词:</label>
                        <div class="col-md-5">
                            <input id="keyword" name="keyword" type="text"
                                   class="form-control tags medium"
                                   value="${data.keyword}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">状态:</label>
                        <div class="col-md-3">
                            <select name="status" class="form-control">
                                <option value="1" <c:if test="${1 == data.status}">selected="selected" </c:if> >有效</option>
                                <option value="0" <c:if test="${0 == data.status}">selected="selected" </c:if> >无效</option>
                            </select>
                        </div>
                    </div>
                    <%--<input type="hidden" id="imgUrl" name="imgUrl" class="form-control"
                           value="${data.imgUrl}"/>
                    <div class="form-group" id="pic">
                        <label class="col-md-2 control-label">封面：</label>
                        <div class="col-md-8">
                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                <div class="fileinput-new thumbnail"
                                     style="width: 300px; height: 150px;">
                                    <img src="${data.imgUrl}">
                                </div>
                                <div class="fileinput-preview fileinput-exists thumbnail"
                                     style="max-width: 300px; max-height: 150px;">
                                </div>
                                <div>
                                    <span class="btn default btn-file">
                                        <span class="fileinput-new">
                                             选择图片
                                        </span>
                                        <span class="fileinput-exists">
                                             修改图片
                                        </span>
                                        <input type="file" id="file" name="file"/>
                                    </span>
                                    <a href="#" class="btn default fileinput-exists"
                                       data-dismiss="fileinput">
                                        移除图片
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>--%>
                    <div class="form-group">
                        <label class="col-md-2 control-label">内容:
                            <span class="required">*</span>
                        </label>
                        <div class="col-md-8">
                            <input id="context" type="hidden" name="context">
                            <script id="editor" type="text/plain" style="height:500px;">${data.context}</script>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="portlet-title">
    <div class="actions btn-set">
        <a href="javascript:history.go(-1);" class="btn default"><i class="fa fa-angle-left" title="返回"></i></a>
        <a href="javascript:location.reload();" class="btn green"><i class="fa fa-reply" title="重置"></i></a>
        <button type="button" class="btn blue save"><i class="fa fa-check" title="保存"></i></button>
    </div>
</div>
</div>
<input type="hidden" id="id" name="id" value="${data.id}">
</form>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery.input-ip-address-control-1.0.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery.pwstrength.bootstrap/src/pwstrength.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/biz/ajaxfileupload.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="${path}/operate/js/help.js"></script>
<script>
    var editor;
    $(function() {
        editor = UE.getEditor('editor');
        $(".save").click(function() {
            var context = editor.getContent();
            if (!/[\w\W]+/.test(context)) {
                alert("内容不能为空");
                return;
            }
            $("#context").val(context);
            $("form").submit();
        });
    });
</script>
</body>
</html>